#pragma once
#include "Styling/SlateStyleRegistry.h"

class FMyStyle{
public:
	static TSharedRef<class ISlateStyle> Create();

	static const ISlateStyle& Get(){
		return *(Instance.Get());
	}

	static void ResetToDefault(){
		SetStyle(FMyStyle::Create());
	}

private:
	static TSharedPtr<class ISlateStyle> Instance;

	static void SetStyle(const TSharedRef<class ISlateStyle>& NewStyle){
		if(Instance.IsValid()){
			FSlateStyleRegistry::UnRegisterSlateStyle(*Instance.Get());
		}

		Instance = NewStyle;
		if(Instance.IsValid()){
			FSlateStyleRegistry::RegisterSlateStyle(*Instance.Get());
		}else{
			ResetToDefault();
		}
	}
};
